<template>
  <mt-header :title="title" :fixed='true'>
    <a href='javascript:history.back()' slot="left">
        <mt-button icon="back" v-show='isShow'>返回</mt-button>
    </a>
    <mt-button slot="right" @click="searchPage" v-show="!productDet">搜索</mt-button>
    <mt-button slot="right" class="fa fa-home" v-show="productDet"></mt-button>
  </mt-header>
</template>

<script>
export default {
  data () {
    return {
    }
  },
  computed: {
    isShow () {
      return !(this.$route.path === '/' || this.$route.path === '/index')
    },
    title () {
      return this.$store.state.title
    },
    productDet () {
      return this.$route.path === '/productDet'
    }
  },
  methods: {
    searchPage () {
      this.$router.push({'path': '/search'})
    }
  }

}
</script>

<style lang="scss" scoped >

</style>
